Move pip install to dedicated GitHub Actions steps#206
Conversation
Co-authored-by: functionstackx <47992694+functionstackx@users.noreply.github.com>
0f30308 to
6fd5041
Compare
There was a problem hiding this comment.
Pull Request Overview
This PR improves GitHub Actions workflow efficiency by moving inline pip install commands into dedicated dependency installation steps with caching enabled. This allows GitHub Actions to cache Python packages between runs, reducing build times and network usage.
Key changes:
- Added
actions/setup-python@v6withcache: 'pip'configuration to 8 workflow files - Removed inline
pip installcommands from bash scripts and Python subprocess calls - Created
requirements-workflows.txtto centralize workflow dependencies
Reviewed Changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
requirements-workflows.txt |
New file documenting all Python dependencies used across workflows |
.github/workflows/test-matrix-logic.yml |
Added pip caching to existing Python setup step |
.github/workflows/label-validation.yml |
Added Python setup with caching and removed inline pip installs from two jobs |
.github/workflows/full-sweep-test.yml |
Added Python setup with caching and removed inline pip installs from config generation and results collection jobs |
.github/workflows/full-sweep-8k1k-scheduler.yml |
Added Python setup with caching to three jobs (dsr1, gptoss config generation, and results collection) |
.github/workflows/full-sweep-1k8k-scheduler.yml |
Added Python setup with caching to three jobs (dsr1, gptoss config generation, and results collection) |
.github/workflows/full-sweep-1k1k-scheduler.yml |
Added Python setup with caching to three jobs (dsr1, gptoss config generation, and results collection) |
.github/workflows/e2e-tests.yml |
Added Python setup with caching and removed inline pip installs from job generation and results collection |
.github/workflows/collect-results.yml |
Added Python setup with caching and simplified plot performance step |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| # Requirements for GitHub Actions workflows | ||
| # Used by various workflow files to generate configs and process results | ||
| pydantic>=2.0.0 | ||
| pyyaml>=6.0.0 | ||
| PyGithub>=2.0.0 | ||
| matplotlib>=3.0.0 | ||
| pytest>=7.0.0 |
There was a problem hiding this comment.
The requirements-workflows.txt file is not referenced by any of the workflow files. The workflows install dependencies directly via pip install <package> commands instead of using pip install -r requirements-workflows.txt. Either update the workflows to use this requirements file, or remove it if it's intended only as documentation.
| # Requirements for GitHub Actions workflows | |
| # Used by various workflow files to generate configs and process results | |
| pydantic>=2.0.0 | |
| pyyaml>=6.0.0 | |
| PyGithub>=2.0.0 | |
| matplotlib>=3.0.0 | |
| pytest>=7.0.0 |
There was a problem hiding this comment.
Removed requirements-workflows.txt as workflows install dependencies directly. (4dd647e)
| cache: 'pip' | ||
|
|
||
| - name: Install dependencies | ||
| run: pip install pydantic pyyaml |
There was a problem hiding this comment.
The workflow installs pydantic and pyyaml but the Python script only imports subprocess, json, and os. The pydantic dependency was previously installed inline before calling generate_sweep_configs.py as a subprocess, which still requires it. However, pyyaml doesn't appear to be needed in this job. Consider installing only the dependencies required by the subprocess call.
| run: pip install pydantic pyyaml | |
| run: pip install pydantic |
There was a problem hiding this comment.
Fixed to install only pydantic (removed pyyaml). (4dd647e)
| cache: 'pip' | ||
|
|
||
| - name: Install dependencies | ||
| run: pip install matplotlib |
There was a problem hiding this comment.
[nitpick] The previous version used pip install -q matplotlib with the -q (quiet) flag to reduce output verbosity. Consider retaining this flag for consistency with the original behavior and cleaner logs.
| run: pip install matplotlib | |
| run: pip install -q matplotlib |
There was a problem hiding this comment.
Restored the -q flag for quiet output. (4dd647e)
|
@copilot Error: No file in /home/runner/work/InferenceMAX/InferenceMAX matched to [**/requirements.txt or **/pyproject.toml], make sure you have checked out the target repository |
Co-authored-by: functionstackx <47992694+functionstackx@users.noreply.github.com>
Removed |
This reverts commit b1df040.
Inline
pip installcommands in workflow run scripts should be moved to proper GitHub Actions steps for better organization and maintainability.Changes
subprocess.run(['pip', 'install', 'pydantic'])and bash script pip commands from 8 workflow filesactions/setup-python@v6with Python 3.12 before dependency installation-qflag for quiet matplotlib installation in collect-results.ymlExample
Before:
After:
Files Modified
.github/workflows/e2e-tests.yml.github/workflows/full-sweep-{1k1k,1k8k,8k1k}-scheduler.yml.github/workflows/full-sweep-test.yml.github/workflows/collect-results.yml.github/workflows/label-validation.yml.github/workflows/test-matrix-logic.ymlView original Slack conversation
View original Slack conversation
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.